﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace OpenFaq.Core.UserModule
{
	[Table("User")]
	public class User
	{
		public int Id { get; set; }

		public Guid Guid { get; set; }

		[Required]
		[MaxLength(100)]
		public string Username { get; set; }

		[Required]
		[MaxLength(256)]
		[DataType(DataType.EmailAddress)]
		public string Email { get; set; }

		[Required]
		[MaxLength(100)]
		[DataType(DataType.Password)]
		public string Password { get; set; }

		[MaxLength(100)]
		public string PasswordQuestion { get; set; }

		[MaxLength(100)]
		public string PasswordAnswer { get; set; }

		public bool IsApproved { get; set; }
		public DateTime DateCreated { get; set; }

		public DateTime LastPasswordChangedDate { get; set; }
		public DateTime LastActivityDate { get; set; }

		public bool IsLockedOut { get; set; }
		public DateTime? LastLockedOutDate { get; set; }
		
		public int FailedPasswordAttemptCount { get; set; }
		public DateTime? FailedPasswordAttemptWindowStart { get; set; }
		public int FailedPasswordAnswerAttemptCount { get; set; }
		public DateTime? FailedPasswordAnswerAttemptWindowStart { get; set; }

		public virtual ICollection<Role> Roles { get; set; }

		//Optional
		//public string FirstName { get; set; }
		//public string LastName { get; set; }
		//public string TimeZone { get; set; }
		//public string Culture { get; set; }

	}

}
